
{template 'common/header'}
<ul class="nav nav-tabs">
	<li {if $op == ''}class="active"{/if}><a href="{php echo $this->createWebUrl('phone', array('op' => ''))}">便民号码管理</a></li>
</ul>
<div class="main">
	<form class="form-horizontal form" action="" method="post" onsubmit="return formcheck(this)">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th class="row-hover span3">电话<i></i></th>
					<th class="row-hover span3">说明<i></i></th>
					<th colspan="4" style="text-align:right;">操作</th>
				</tr>
			</thead>
			<tbody id="status-items">
			{loop $phones $phone}
				<tr>
					<td><input name="phones[]" type="text" value="{$phone['phone']}" class="form-control"></td>
					<td><input name="titles[]" type="text" value="{$phone['title']}" class="form-control">
						<input name="ids[]" type="hidden" value="{$phone['id']}">
					<input name="weids[]" type="hidden" value="{$phone['weid']}"></td>
					<td style="text-align:right;" colspan="4">
						<a onclick="if (confirm('删除操作不可恢复，确认吗？')){ $(this).parent().parent().next().remove(); return true;} else {return false;}" href="{php echo $this->createWebUrl('phone', array('op' => 'delete', 'id' => $phone['id']))}" class="btn btn-small" title="删除"><i class="glyphicon glyphicon-remove-circle"></i></a></td>
				</tr>
			{/loop}
			</tbody>
			<tr>
				<td colspan="6">
					<a href="javascript:;" onclick="addStatusItem()"><i class="icon-plus-sign-alt"></i> 添加新电话</a>
				</td>
			</tr>
		</table>
		<table class="tb">
			<tr>
				<td colspan="6">
					<button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
					<input type="hidden" name="token" value="{$_W['token']}" />
				</td>
			</tr>
		</table>
	</form>
</div>
<script type="text/javascript">
<!--
	function addStatusItem() {
		var html = '' +
				'<tr>' +
					'<td><input name="phones[]" type="text" class="form-control"/></td>' +
					'<td><input name="titles[]" type="text" value="" class="form-control"><input name="ids[]" type="hidden" value=""><input name="weids[]" type="hidden" value="{$weid}"></td>' +
					'<td style="text-align:right;" colspan="3"><a href="javascript:;" onclick="$(this).parent().parent().remove();" class="btn btn-small" title="删除此条目"><i class="icon-remove"></i></a></td>' +
				'</tr>';
		$('#status-items').append(html);
	}
//-->
</script>
<div class="list img-rounded" style="padding-top: 0; padding-bottom: 0;">
{$pager}
</div>

{template 'common/footer'}